<style>
    .row{margin-bottom: 20px;}
</style>
<section class="content">
    <div class="search">
        <form role="form">
            <div class="row">
                <div class="col-xs-2">
                    <select ng-model="channelModel.goodsId" class="form-control">
                        <option value="">全部</option>
                        <option ng-repeat="c in goodsList" value="{{c.wxGoodsId}}">{{c.name}}</option>
                    </select>
                </div>
                <div class="col-xs-1">
                    <div class="form-group" >
                        <input type="text" class="form-control" placeholder="套餐名称" ng-model="channelModel.channelName">
                    </div>
                </div>

                <div class="col-xs-1">
                    <input type="button" class="btn-primary btn" ng-click="channel(1)" value="查询">
                </div>
                <div class="col-xs-1">
                    <input type="button" class="btn-default btn" value="添加渠道二维码" data-toggle="modal" data-target="#addChannelCode" >
                </div>

            </div>
        </form>
    </div>
    <div class="table-box">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>渠道序号</th>
                <th>渠道名称</th>
                <th>电话</th>
                <th>昵称</th>
                <th>添加日期</th>
                <th>套餐名</th>
                <th>拉新数</th>
                <th>订单数</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat=" n in channelList">
                <td>{{$index+1}}</td>
                <td>{{n.channelName}}</td>
                <td>{{n.cellPhone}}</td>
                <td>{{n.nickname}}</td>
                <td>{{n.addTime}}</td>
                <td>
                    <span ng-repeat="i in n.goodsList">
                        {{i.goodsName}}&emsp;&emsp;
                    </span>
                </td>
                <td>{{n.attentionPeoples}}</td>
                <td>{{n.orderCount}}</td>
                <td>
                    <a href="javascript:;" ng-click="setting(n)" data-toggle="modal" data-target="#myModal">设置</a> |
                    <a href="javascript:;" ng-click="examine(n)" data-toggle="modal" data-target="#examineModal">审核</a> |
                    <a href="javascript:;" ng-click="download(n)">下载</a> |
                    <a ng-if="n.audit!='1'" href="javascript:;" ng-click="forbid(n)">禁用</a>
                    <span ng-if="n.audit=='1'">禁用</span>
                </td>
            </tr>
            <tr ng-if="channelList.length<=0">
                <td colspan="9" class="text-center">暂无数据！</td>
            </tr>
            </tbody>
        </table>
        <div class="page-function" ng-if="channelList.length > 0"></div>
    </div>
    <!--设置服务包-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel1">
                        设置
                    </h4>
                </div>
                <div class="modal-body">
                   <div class="row">
                       <div class="col-xs-12">请设置要开通的服务包项目：</div>
                   </div>
                    <div class="row">
                        <div class="col-xs-12" id="goodsList" >
                            <label ng-repeat="c in goodsList">
                                <input type="checkbox" value="{{c.wxGoodsId}}"> {{c.name}}&emsp;&emsp;
                            </label>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="commitSevers()">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!--审核-->
    <div class="modal fade" id="examineModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="tagsModalLabel2">
                        审核
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-xs-12">请确认是否通过{{currentItem.channelName}}开通</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <b ng-repeat="n in selectedGoodsList">{{n.goodsName}}&emsp;&emsp;</b>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">推荐人的审核？</div>
                    </div>

                </div>
                <div class="modal-footer">
                    <div class="col-xs-12 btn-fun">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" ng-click="examineCommit()">确定</button>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!--添加渠道二维码-->
    <div class="modal fade" id="addChannelCode" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel3">
                        添加渠道二维码
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-xs-2">渠道名称：</div>
                        <div class="col-xs-10">
                            <input type="text"  ng-model="channelName" class="form-control" placeholder="请输入渠道名称">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2">电话：</div>
                        <div class="col-xs-10">
                            <input type="text" ng-model="cellPhone" class="form-control" placeholder="请输入电话号码">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" ng-click="resetChannel()">重置</button>
                    <button type="button" class="btn btn-primary" ng-click="addChannelCode()">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</section>